{% extends 'base.html' %}

{% block title %}我的订单{% endblock %}

{% block content %}
<h1 class="mb-4">我的订单</h1>

<div class="list-group">
    {% for order in orders %}
    <a href="{% url 'order_detail' order.id %}" class="list-group-item list-group-item-action">
        <div class="d-flex w-100 justify-content-between">
            <h5 class="mb-1">订单 #{{ order.id }} - {{ order.restaurant.name }}</h5>
            <small>{{ order.created_at|date:"Y-m-d H:i" }}</small>
        </div>
        <p class="mb-1">总金额：¥{{ order.total_amount }}</p>
        <small class="text-muted">状态：{{ order.get_status_display }}</small>
    </a>
    {% empty %}
    <p>暂无订单</p>
    {% endfor %}
</div>
{% endblock %}